package com.sxjh.entity.result;

import com.sxjh.common.Constant;
import com.sxjh.entity.Task;
import com.sxjh.enums.NodeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Set;

@Data
@EqualsAndHashCode(callSuper = false)
public class TaskListResult extends Task {

    @ApiModelProperty(value = "车号ID11")
    private Integer vehicleId;

    @ApiModelProperty(value = "计划单名称")
    private String title;

    @ApiModelProperty("车号")
    private String vehNumber;

    @ApiModelProperty("司机姓名")
    private String driverName;

    @ApiModelProperty("承运单位")
    private String unitName;

    @ApiModelProperty("物料名称")
    private String materialName;

    @ApiModelProperty(value = "装货地id")
    private Integer locationUpId;

    @ApiModelProperty(value = "装货地名称")
    private String locationUpName;

    @ApiModelProperty(value = "下一节点0:未执行,1:初磅,2:装车拍照,3:二次磅,4:卸货拍照,5:刷卡完成")
    private Integer nextNode;

    @ApiModelProperty(value = "下一节点名称0:未执行,1:初磅,2:装车拍照,3:二次磅,4:卸货拍照,5:刷卡完成")
    private String nextNodeName;

    @ApiModelProperty(value = "当前节点0:未执行,1:初磅,2:装车拍照,3:二次磅,4:卸货拍照,5:刷卡完成")
    private String currNodeName;

    /**
     * 卸货地id
     */
    @ApiModelProperty(value = "卸货地id")
    private Integer locationDownId;

    @ApiModelProperty(value = "卸货地名称")
    private String locationDownName;

    @ApiModelProperty(value = "装货点所属工厂id")
    private Integer locationUpFactoryId;

    @ApiModelProperty(value = "装货点所属工厂名称")
    private String locationUpFactoryName;

    @ApiModelProperty(value = "装货点所属车间id")
    private Integer locationUpWorkshopId;

    @ApiModelProperty(value = "装货点所属车间名称")
    private String locationUpWorkshopName;


    @ApiModelProperty(value = "卸货点所属工厂id")
    private Integer locationDownFactoryId;

    @ApiModelProperty(value = "卸货点所属工厂名称")
    private String locationDownFactoryName;

    @ApiModelProperty(value = "卸货点所属车间id")
    private Integer locationDownWorkshopId;

    @ApiModelProperty(value = "卸货点所属车间名称")
    private String locationDownWorkshopName;

    @ApiModelProperty("装货地是否需要拍照1:否,-1:是")
    private Integer upPhotoFlag;

    @ApiModelProperty("卸货地是否需要拍照1:否,-1:是")
    private Integer downPhotoFlag;

    @ApiModelProperty("卸货地是否需要确认1:否,-1:是")
    private Integer downConfirmFlag;

    @ApiModelProperty("每页显示条数")
    private long size = Constant.size;

    @ApiModelProperty("当前页")
    protected long current = Constant.current;

    @ApiModelProperty("派车单列表标识：1.派车单管理列表, 2.异常流程处理列表")
    private Integer dispatchListFlag;

    @ApiModelProperty("ic卡号")
    private String icNumber;

    @ApiModelProperty("印刷编号")
    private String printing;

    private Set<Integer> upFactoryIdList;

    public void setCurrNodeName(String currNodeName) {
        String currNodeName1 = NodeEnum.getCurrNodeName(getCurrNode());
        if (getCurrNode() != null && getCurrNode() != 0) {
            currNodeName1 = NodeEnum.getCurrNodeName(getCurrNode()) + "完成";
        }
        this.currNodeName = currNodeName1;
    }

}
